<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <!-- <meta http-equiv="X-Frame-Options" content="SAMEORIGIN"> -->
  <!-- gxt/css/gxt-all.css -->
  <link rel="stylesheet" type="text/css" href="/selfec/gxt/css/ext-all.css"/>

  <script type="text/javascript" src="/selfec/resources/js/ext-base.js"></script>
  <script type="text/javascript" src="/selfec/resources/js/ext-all.js"></script>
  <script type="text/javascript" src="/selfec/resources/js/ext-lang-zh_CN.js"></script>

  <title>广东省自学考试管理系统</title>
  <style type="text/css">
    body {
      margin: 0;
      padding: 0;
      border: 0 none;
      height: 100%;
      width: 100%;
      background: #fff;
      text-align: center;
      vertical-align: bottom;
    }

    #loginTop {
      width: 100%;
      height: 10%;
    }

    #loginPic {
      width: 600;
      height: 250;
      /*background-image : url('images/login.jpg');*/
      background-repeat: no-repeat;
      margin-left: auto;
      margin-right: auto;
      margin-top: auto;
      margin-bottom: auto;
    }

    #loginForm {
      width: 500;
      text-align: left;
      position: relative;
      top: 30;
      margin-left: auto;
      margin-right: auto;
    }

    .input_check_box {
      width: 95px;
      height: 28px;
      border: 1px solid #fff;
      cursor: pointer;
      float: left;
      font-size: 12px;
      color: #fff;
    }

    .input_check_text {
      font-size: 12px;
      cursor: pointer;
      /*text-decoration:underline;
color:#fff;
*/
      float: left;
      margin: 15 0 0 0;
    }

    #codeDiv {
      margin: 0 auto;
      width: 300px;
    }

    p {
      font-size: 12px;
      color: #333;
      text-align: center;
    }

    p.model {
      text-align: left;
    }

    p.text {
      font-size: 14px;
      color: #205EB1;
      margin: 0 auto;
      margin-top: 20px;
      width: 80%;
      line-height: 1.5em;
    }

    a:link {
      text-decoration: none;
    }

    a:visited {
      text-decoration: none;
      color: #205EB1;
    }

    #ggao {
      width: 600px;
      margin: auto;
    }

    #ggao ul {
      margin-left: 70px;
    }

    #ggao ul li {
      margin-top: 5px;
      font-size: 13px;
      list-style: disc;
    }

  </style>
</head>
<body>
<div id="loginTop"></div>
<div id="loginPic">
  <div id="loginForm"></div>
</div>
<div align="left" id="ggao">
  <ul id="ul_id">
    <li><a href="http://www.stegd.edu.cn:80/selfec/main/bysqxz.jsp" target="_blank" style="color: red;">办理毕业申请须知</a>
    </li>
    <li><a href="http://www.stegd.edu.cn:80/selfec/main/blxlzmxz.jsp" target="_blank">办理学历证明须知</a></li>
  </ul>
</div>
<!--
<p class="text"><a href="/selfec/login/viewGg.jsp">最近公告...</a></p> -->
<div style="top: 30px;position: relative;">
  <p class="text"><span><strong>©广东省教育考试院</strong></span>
    <br/>2010-2020 版权所有
    <br/>地址：广东省广州市中山大道西69号 邮编：510631
    <br/>电子邮箱：selfec@ecogd.edu.cn
  </p>
  <p class="text">推荐使用<a href="http://www.google.com/chrome">Google浏览器</a>，还在使用IE6的用户，建议升级到IE8.</p>
</div>
</body>
<!-- <script type="text/javascript">
    if(top != self){
        location.href = "about:blank";
    }
</script> -->
<script language="javascript">
  var account, password, addcode
  Ext.onReady(function () {
    Ext.QuickTips.init()
    Ext.form.Field.prototype.msgTarget = 'side'
    var winWidth = 500
    var winHeight = 200

    account = new Ext.form.TextField({
      fieldLabel: '准考证号<font color="red">*</font>',
      allowBlank: false, selectOnFocus: true,
      blankText: '准考证号不允许为空',
      name: 'account',

      maxLength: '32', anchor: '90%'
    })

    password = new Ext.form.TextField({
      inputType: 'password', name: 'password',
      fieldLabel: '密码<font color="red">*</font>',
      allowBlank: false, blankText: '密码不允许为空',

      maxLength: '32', anchor: '90%'
    })

    addcode = new Ext.form.TextField({
      name: 'addcode', fieldLabel: '验证码<font color="red">*</font>',
      allowBlank: false, blankText: '验证码不允许为空',
      maxLength: '4', anchor: '90%'

    })

    password.on('focus', function () {
      var codeDivObj = document.getElementById('codeDiv')
      if (codeDivObj.style.display == 'none') {
        codeDivObj.style.display = 'block'
        refreshAddcode(true)
      }
    })

    var codeHtml = '<div id="codeDiv" style="display:none">'
      + '	<div class="input_check_box" onClick="refreshAddcode();">'
      + '	 <img id="randomImage" name="randomImage" src=""'
      + '		 width="95" height="28" border="0" style="position:absolute;;z-index:1;">'
      + '	</div>'
      + '	<div class="input_check_text" onClick="refreshAddcode();">'
      + '		&nbsp;&nbsp;重新获取验证码！'
      + '	</div>'
      + '</div>'

    var codePanel = new Ext.Panel({border: false, html: codeHtml})

    var allPanel = new Ext.Panel({
      border: false, layout: 'column', width: winWidth - 20,
      items: [
        {columnWidth: 1, border: false, layout: 'form', items: [account]},
        {columnWidth: 1, border: false, layout: 'form', items: [password]},
        {columnWidth: .4, border: false, layout: 'form', items: [addcode]},
        {columnWidth: .6, border: false, layout: 'form', items: [codePanel]}
      ]
    })

    var devMode = new Ext.form.Hidden({
      name: 'devMode', value: 'false'
    })

    var operate = new Ext.form.Hidden({
      name: 'operate', value: 'login'
    })

    var formPanel = new Ext.form.FormPanel({
      title: '广东省自学考试管理系统', labelAlign: 'right', labelWidth: 80,
      width: winWidth, height: winHeight,
      frame: true, region: 'center',
      bodyStyle: 'padding:15px 5px 5px',
      defaultType: 'textfield',
      keys: [{
        key: [10, 13], fn: formSubmit
      }
      ],
      items: [allPanel, devMode, operate],
      buttonAlign: 'center', buttons: [
        {
          text: '忘记密码', handler: function () {
            window.location = '/selfec/login/getPwd.jsp'
          }
        },
        {text: '登 录', handler: formSubmit},

        {
          text: '社会考生预报名', hidden: false, handler: function () {

            Ext.MessageBox.alert('错误提示', '请在规定的时间内进行预报名！')

          }
        },

        {
          text: '预报名修改', handler: function () {

            Ext.MessageBox.alert('错误提示', '请在规定的时间内进行预报名修改！')

          }
        }
      ],
      renderTo: 'loginForm'
    })

    account.focus(true, false)

    function formSubmit () {
      if (formPanel.form.isValid()) {
        account.setValue(account.getValue().trim())
        formPanel.form.submit({
          url: '/selfec/login/login.do', method: 'get',
          params: {operate: operate.getValue()},
          waitMsg: '正在登录，请稍候...',
          failure: function (form, action) {
            Ext.MessageBox.alert('错误提示', action.result.errorInfo)
            //刷新验证码
            refreshAddcode()
          },
          success: function (form, action) {
            //formPanel.form.reset() ;
            account.setValue('')
            password.setValue('')
            addcode.setValue('')
            //刷新验证码
            refreshAddcode()
            var ww = window.screen.width
            var hh = window.screen.height
            if ('true' == 'true') {
              ww -= 75
              hh -= 35
            }
            var opt = 'toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,'
              + 'resizable=yes,status=no,top=0,left=0,width=' + ww + ',height=' + hh

            var url = '/selfec' + action.result.info
            window.open(url, '', opt)

            //window.location = action.result.info;
          }
        })
      } else {
        Ext.MessageBox.alert('错误提示', '请正确输入准考证号与密码！')
      }
    }
  })

  function refreshAddcode (isCheck) {
    addcode.reset()
    document.getElementById('randomImage').src = '/selfec/login/login.addcode?_t=' + Math.random()
    if (!isCheck) {
      if (!account.getValue()) {
        account.focus(true, false)
      } else if (!password.getValue()) {
        password.focus(true, false)
      } else if (!addcode.getValue()) {
        addcode.focus(true, false)
      }
    }

  }
</script>
</html>
